#include "Mat_Chain_Mul_Calculator.h"

int main(){
    vector<int> p1 = {24328, 18379, 35569, 67278, 49933, 36006};
    vector<int> p2 = {71048, 47356, 1383, 82762, 75138, 55089, 45196, 19829, 71323, 56242, 64531};
    vector<int> p3 = {86, 45957, 28899, 70941, 56147, 69560, 77373, 58331, 76247, 80282, 66558, 66841, 73727, 55239, 89817, 81459};
    vector<int> p4 = {79428, 50428, 33731, 14626, 87202, 22106, 27567, 59704 ,28733, 14218, 16804,
                         62761, 56126, 45097, 39841, 9563, 61966, 17560, 55756, 27693, 63993};
    vector<int> p5 = {42893, 66264, 18220, 80049, 80654 ,74178 ,31575 ,13565, 87907, 44416 ,46667 ,10280,
                         14610, 40446, 25215, 21953, 69014, 32578, 45382, 67577, 13627, 56594, 77078, 40477, 52588, 65587};


    auto calc = Mat_Chain_Mul_Calculator(&p1);
    calc.run();
    cout << endl << endl;
    cout << "预运行完成。上一次运行结果不用于验证复杂度。" << endl;

    //run()函数第一次调用时运行速度较慢，之后运行速度正常，可能是编译器优化和系统堆栈管理的原因
    //所以第一次作为预运行，不用于验证复杂度
    calc = Mat_Chain_Mul_Calculator(&p1);
    calc.run();
    calc.print_ms();

    calc = Mat_Chain_Mul_Calculator(&p2);
    calc.run();

    calc = Mat_Chain_Mul_Calculator(&p3);
    calc.run();

    calc = Mat_Chain_Mul_Calculator(&p4);
    calc.run();

    calc = Mat_Chain_Mul_Calculator(&p5);
    calc.run();
}